package com.pan.games.leecode;

/**
 * @author by panstark
 * @description
 * @notice
 * @date 2021/3/24
 */
public class TwoSum {

    public int[] twoSum(int[] nums, int target) {

        int[] index = new int[2];
        for (int i = 0; i < nums.length; i++) {
            for (int i1 = i+1; i1 < nums.length; i1++) {
                int sum = nums[i]+nums[i1];
                if(sum == target){
                    index[0]=i;
                    index[1]=i1;
                    break;
                }
            }
        }
        return index;

    }
}
